#pragma once
#include "ProjectPlan/PPContext.h"
#include "PPCalendarImp.h"
#include "PPTaskImp.h"

namespace LBPROJ
{
    class CPPContext : public IPPContext
    {
        IMPLEMENT_REFCOUNTING(CPPContext)
    public:
        CPPContext();
        virtual ~CPPContext();

    public:
        virtual void SetID(const std::wstring&) const;
        virtual const std::wstring& GetID() const;

        virtual CRefPtr<ITaskGroup> GetTaskGroup();
        virtual CRefPtr<ICalendar> GetCalendar() const;

        virtual bool Open(LBPROJSTREAM::IProjPlanStreamDatabase* pDb);
        virtual bool Write(LBPROJSTREAM::IProjPlanStreamDatabase* pDb) const;

    protected:
        mutable std::wstring m_id;

        CRefPtr<ICalendar> m_pCalendar;
        CRefPtr<ITaskGroup> m_pTaskGroup;
    };
}